let s = "luffy is still joyboy"
var lengthOfLastWord = function (s) {
    let len = 0
    let sum = 0
    for (let i = 0; i < s.length; i++) {
        if (s[i].charCodeAt(0) !== 32) {
            sum++
            len = sum
        }
        else {
            sum = 0
        }
        // console.log(sum, len);

    }
    return len
};
console.log(lengthOfLastWord(s));
